<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/radardevice/devices/measureinfo.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/radardevice/devices/measureinfo.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'id',
                footer: "Foots",
                cnName: '测量信息',
                name: 'devices/measureinfo',
                url: "/measureinfo/",
                sortName: "uploadTime"
            });
            const editFormFields = ref({"deviceNo":"","uploadTime":"","alarmFlag":"","targetDistance1":"","targetSnr1":"","targetDistance2":"","targetSnr2":"","targetDistance3":"","targetSnr3":"","createTime":"","commandStr":""});
            const editFormOptions = ref([[{"title":"设备编号","field":"deviceNo","disabled":true,"type":"text"}],
                              [{"title":"产生时间","required":true,"field":"uploadTime","disabled":true,"type":"text"},
                               {"dataKey":"alarmFlag","data":[],"title":"报警标志","field":"alarmFlag","disabled":true,"type":"select"}],
                              [{"title":"目标1距离","field":"targetDistance1","disabled":true,"type":"text"},
                               {"title":"目标1 SNR","field":"targetSnr1","disabled":true,"type":"text"}],
                              [{"title":"目标2距离","field":"targetDistance2","disabled":true,"type":"text"},
                               {"title":"目标2 SNR","field":"targetSnr2","disabled":true,"type":"text"}],
                              [{"title":"目标3距离","field":"targetDistance3","disabled":true,"type":"text"},
                               {"title":"目标2 SNR","field":"targetSnr3","disabled":true,"type":"text"}],
                              [{"title":"记录时间","field":"createTime","disabled":true,"type":"text"}],
                              [{"title":"原指令字符","field":"commandStr","disabled":true,"type":"textarea"}]]);
            const searchFormFields = ref({"deviceNo":"","uploadTime":"","alarmFlag":""});
            const searchFormOptions = ref([[{"title":"设备编号","field":"deviceNo","type":"like"},{"dataKey":"alarmFlag","data":[],"title":"报警标志","field":"alarmFlag","type":"select"}],[{"title":"产生时间","field":"uploadTime","type":"datetime"}]]);
            const columns = ref([{field:'id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'device_id',title:'设备Id',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'deviceNo',title:'设备编号',type:'string',link:true,width:180,readonly:true,align:'left',sort:true},
                       {field:'uploadTime',title:'产生时间',type:'datetime',width:160,readonly:true,require:true,align:'left',sort:true},
                       {field:'alarmFlag',title:'报警标志',type:'int',bind:{ key:'alarmFlag',data:[]},width:85,readonly:true,align:'left'},
                       {field:'targetDistance1',title:'目标1距离',type:'int',width:90,readonly:true,align:'left'},
                       {field:'targetSnr1',title:'目标1 SNR',type:'decimal',width:90,readonly:true,align:'left'},
                       {field:'targetDistance2',title:'目标2距离',type:'int',width:90,readonly:true,align:'left'},
                       {field:'targetSnr2',title:'目标2 SNR',type:'decimal',width:90,readonly:true,align:'left'},
                       {field:'targetDistance3',title:'目标3距离',type:'int',width:90,readonly:true,align:'left'},
                       {field:'targetSnr3',title:'目标2 SNR',type:'decimal',width:90,readonly:true,align:'left'},
                       {field:'commandStr',title:'原指令字符',showOverflowTooltip:'true',type:'string',width:120,readonly:true,align:'left'},
                       {field:'createTime',title:'记录时间',type:'datetime',width:160,readonly:true,align:'left',sort:true},
                       {field:'CreateID',title:'设备所属用户',type:'int',width:120,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
